
package net.qiqbframework.common.transaction;

/**
 * 无事物实现
 */
public enum NoTransactionManager implements TransactionManager {

    /**
     * 单例
     */
    INSTANCE;


    public static TransactionManager instance() {
        return INSTANCE;
    }

    @Override
    public Transaction startTransaction() {
        return TRANSACTION;
    }

    private static final Transaction TRANSACTION = new Transaction() {
        @Override
        public void commit() {
            // no op
        }

        @Override
        public void rollback() {
            // no op
        }
    };
}
